package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.WebUserResultFollow;
import com.ruoyi.system.mapper.WebUserResultFollowMapper;
import com.ruoyi.system.service.IWebUserResultFollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * 效果跟进Service业务层处理
 * 
 * @author wsliupan@126.com
 * @date 2021-07-02
 */
@Service
public class WebUserResultFollowServiceImpl extends ServiceImpl<WebUserResultFollowMapper, WebUserResultFollow> implements IWebUserResultFollowService
{
    @Autowired
    private WebUserResultFollowMapper webUserResultFollowMapper;

    /**
     * 查询效果跟进
     * 
     * @param id 效果跟进ID
     * @return 效果跟进
     */
    @Override
    public WebUserResultFollow selectWebUserResultFollowById(Long id)
    {
        return webUserResultFollowMapper.selectWebUserResultFollowById(id);
    }

    /**
     * 查询效果跟进列表
     * 
     * @param webUserResultFollow 效果跟进
     * @return 效果跟进
     */
    @Override
    @DataScope(deptAlias = "t1")
    public List<WebUserResultFollow> selectWebUserResultFollowList(WebUserResultFollow webUserResultFollow)
    {
        return webUserResultFollowMapper.selectWebUserResultFollowList(webUserResultFollow);
    }

    /**
     * 新增效果跟进
     * 
     * @param webUserResultFollow 效果跟进
     * @return 结果
     */
    @Override
    public int insertWebUserResultFollow(WebUserResultFollow webUserResultFollow)
    {
        webUserResultFollow.setCreateTime(DateUtils.getNowDate());
        return webUserResultFollowMapper.insertWebUserResultFollow(webUserResultFollow);
    }

    /**
     * 修改效果跟进
     * 
     * @param webUserResultFollow 效果跟进
     * @return 结果
     */
    @Override
    public boolean updateWebUserResultFollow(WebUserResultFollow webUserResultFollow)
    {
        //webUserResultFollow.setUpdateTime(DateUtils.getNowDate());
        //return webUserResultFollowMapper.updateWebUserResultFollow(webUserResultFollow);
        return this.saveOrUpdate(webUserResultFollow);
    }

    /**
     * 删除效果跟进对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public boolean deleteWebUserResultFollowByIds(String ids)
    {
        //return webUserResultFollowMapper.deleteWebUserResultFollowByIds(Convert.toStrArray(ids));
        return this.removeByIds(Arrays.asList(Convert.toStrArray(ids)));
    }

    /**
     * 删除效果跟进信息
     * 
     * @param id 效果跟进ID
     * @return 结果
     */
    @Override
    public boolean deleteWebUserResultFollowById(Long id)
    {
        //return webUserResultFollowMapper.deleteWebUserResultFollowById(id);
        return this.removeById(id);
    }
}
